<?php echo $this->fetch('header.html'); ?>
<script type="text/javascript" src="<?php echo SITE_URL."/includes/libraries/javascript/" . 'datePicker/WdatePicker.js'; ?>" charset="utf-8"></script>
<style>
.kdorder_add {background:#e9e9e9;}
.kdorder_add td{padding:5px; background:#FFF; line-height:22px;}
.kdorder_add th {font-size:13px; color:#333; background:#f0f7ff; width:150px; font-weight:normal;text-align:right; padding-right:5px;}
.kdorder_add th em {font-style:normal; color:#F00; margin-right:8px}
.kdorder_add .select_class {border: 1px #fff solid;height: 30px;border-radius:2px;width:50%}
.inputBorder{border: 1px #fff solid;height: 20px;line-height: 20px;padding:4px 0; width:50%}
.botton_submit {border:0;background:#ed5736;height:31px;width:100px;text-align:center;line-height:31px;font-family:"Microsoft YaHei";font-size:14px;color:#fff;cursor:pointer;border-radius:4px; margin-right:10px}
</style>
<div id="rightTop">
  <ul class="subnav">
    <li><a class="btn1" href="index.php?app=kd_yubao">预报记录</a></li>
    <li><a class="btn0" href="index.php?app=kd_yubao&act=add">到货预报</a></li>
    <li><a class="btn1" href="index.php?app=kd_yubao&act=ruku">快速入库</a></li>
  </ul>
</div>
<form action="" method="post" id="form_box">
<table width="100%" cellspacing="1" class="kdorder_add">
  <tr><td colspan="2" style="padding:12px 8px;background:#ffffe5;line-height:18px; font-size:13px">提示：客户没有在前台添加到货预报时帮客户添加的，或者可以直接帮客户<a href="index.php?app=kd_order&amp;act=add" style="color:#00F">添加运单</a>，填写了运单就不需要再填写到货预报。</td></tr>
  <?php if ($this->_var['info']['order_id']): ?>
  <tr>
    <th>运单号：</th>
    <td><a href="index.php?app=kd_order&act=edit&order_id=<?php echo $this->_var['info']['order_id']; ?>" style="color:#00F" target="_blank"><?php echo $this->_var['info']['order_sn']; ?></a> <font color="#FF0000">（点击查看详细）</font></td>
  </tr>
  <?php endif; ?>
  <tr>
    <th><em>*</em>到货仓库：</th>
    <td>
    <select name="cangku" id="cangku" class="select_class">
    <option value="0">=请选择=</option>
    <?php $_from = $this->_var['category']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'list');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['list']):
?>
    <option value="<?php echo $this->_var['list']['cate_name']; ?>" <?php if ($this->_var['info']['cangku'] == $this->_var['list']['cate_name']): ?>selected="selected"<?php endif; ?>><?php echo $this->_var['list']['cate_name']; ?></option>
    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </select>        
    </td>
  </tr>  
  <tr>
    <th><em>*</em>包裹运单号：</th>
    <td><?php if ($this->_var['info']['yundanhao']): ?><input name="yundanhao" type="text" class="inputBorder" id="yundanhao" value="<?php echo $this->_var['info']['yundanhao']; ?>" /><?php else: ?>
    <p style="float:left"><textarea name="yundanhao" class="inputBorder" id="yundanhao" style="width:450px;height:56px;" ></textarea></p>
    <p style="float:left;width:330px;padding-left:8px;color:#999">如果相同的物品可以批量添加，请录入您的包裹运单号，<br />如：789798798US，一行一个单号，按回车键换行。<br />重复或已存在的单号将会被过滤</p>
    <?php endif; ?>
    </td>
  </tr>
  <tr>
    <th><em>*</em>派件快递公司：</th>
    <td>
    <select name="PostOfficeID" id="PostOfficeID" class="select_class">
    <option value="">请选择</option>
    <?php $_from = $this->_var['kuaidi_data']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('i', 'list');if (count($_from)):
    foreach ($_from AS $this->_var['i'] => $this->_var['list']):
?><?php if ($this->_var['list']['type'] == "1"): ?>
    <option value="<?php echo $this->_var['list']['title']; ?>" <?php if ($this->_var['info']['PostOfficeID'] == $this->_var['list']['title']): ?>selected="selected"<?php endif; ?>><?php echo $this->_var['list']['title']; ?></option>
    <?php endif; ?><?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </select>      
    </td>
  </tr>
  <tr>
    <th><em>*</em>物品名称：</th>
    <td><input type="input" class="inputBorder" name="GoodsName" id="GoodsName" value="<?php echo $this->_var['info']['GoodsName']; ?>" placeholder="请输入物品名称"/></td>
  </tr>
  <tr>
    <th><em>*</em>物品数量：</th>
    <td><input type="input" class="inputBorder" name="GoodsCount" id="GoodsCount" onKeyUp="clearNoNum(this)" value="<?php echo $this->_var['info']['GoodsCount']; ?>" placeholder="请输入物品数量"/> (件)</td>
  </tr>
  <tr>
    <th><em>*</em>物品价值：</th>
    <td><input type="input" class="inputBorder" name="GoodsWorth" id="GoodsWorth" onKeyUp="clearNoNum(this)" value="<?php echo $this->_var['info']['GoodsWorth']; ?>" placeholder="请输入物品价值"/> ($)</td>
  </tr>
  <tr>
    <th><em>*</em>物品重量：</th>
    <td><input type="input" class="inputBorder" name="GoodsWeight" id="GoodsWeight" onKeyUp="clearNoNum(this)" value="<?php echo $this->_var['info']['GoodsWeight']; ?>" placeholder="请输入物品重量"/> (LB)</td>
  </tr>
  <tr>
    <th valign="top" style="padding-top:8px">客户预报说明：</th>
    <td><?php if ($this->_var['info']['notes']): ?><?php echo $this->_var['info']['notes']; ?><?php else: ?><textarea name="notes" id="notes" class="inputBorder" style="height:50px;" placeholder="请输入客户预报说明"></textarea><?php endif; ?></td>
  </tr>
  <tr>
    <th>库存位置：</th>
    <td><input type="input" class="inputBorder" name="CangkuWeizhi" id="CangkuWeizhi" value="<?php echo $this->_var['info']['CangkuWeizhi']; ?>" placeholder="请输入库存位置" style="border-color:#CCC"/></td>
  </tr>
  <tr>
    <th>入库日期：</th>
    <td><input type="input" class="inputBorder" name="rukutime" id="rukutime" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'<?php if ($this->_var['info']['addtime']): ?>,minDate:'<?php echo local_date("Y-m-d",$this->_var['info']['addtime']); ?>'<?php endif; ?>})" value="<?php if ($this->_var['info']['rukutime']): ?><?php echo local_date("Y-m-d H:i:s",$this->_var['info']['rukutime']); ?><?php endif; ?>" placeholder="请输入入库日期" style="border-color:#CCC"/></td>
  </tr>    
  <tr>
    <th>状态：</th>
    <td>
    <select name="status" id="status" class="select_class" style="border-color:#CCC">
	<option value="0" <?php if ($this->_var['info']['status'] == '0'): ?>selected="selected"<?php endif; ?>>未入库</option>
    <option value="1" <?php if ($this->_var['info']['status'] == '1'): ?>selected="selected"<?php endif; ?>>已入库</option>
	<option value="2" <?php if ($this->_var['info']['status'] == '2'): ?>selected="selected"<?php endif; ?>>已发出</option>
    <option value="3" <?php if ($this->_var['info']['status'] == '3'): ?>selected="selected"<?php endif; ?>>转仓包裹</option>
    <option value="4" <?php if ($this->_var['info']['status'] == '4'): ?>selected="selected"<?php endif; ?>>问题件</option> 
    <option value="5" <?php if ($this->_var['info']['status'] == '5'): ?>selected="selected"<?php endif; ?>>待认领包裹</option>
    <option value="6" <?php if ($this->_var['info']['status'] == '6'): ?>selected="selected"<?php endif; ?>>无效/取消</option>   
    </select>    
    </td>
  </tr>     
  <tr>
    <th valign="top" style="padding-top:8px">管理员备注：</th>
    <td><?php if ($this->_var['info']['admin_genzong']): ?><p><?php echo(@ereg_replace("\r\n","<br />",$this->_var['info']['admin_genzong'])); ?></p><?php endif; ?>
      <input name="admin_genzong" type="text" class="inputBorder" id="admin_genzong" style="border-color:#CCC" value="" placeholder="请输入管理员备注" /></td>
  </tr>    
  <tr>
    <th>&nbsp;</th>
    <td>
    <input type="button" name="imgButton" class="botton_submit" value="确认提交" onclick="return Check_form();" />
    <input type="reset" class="botton_submit" value="返回上一页" style="background:#999" onclick="javascript:history.back();"/>
    <input type="hidden" name="http_referer" value="<?php echo($_SERVER['HTTP_REFERER']); ?>"/>
    <?php if ($this->_var['info']['yubao_id']): ?>
    <input type="hidden" name="id"  value="<?php echo $this->_var['info']['yubao_id']; ?>"/><input type="hidden" name="act"  value="edit"/>
    <?php else: ?>
    <input type="hidden" name="act"  value="add"/>
    <?php endif; ?>
 </td>
  </tr>
</table>

</form>
<script type="text/javascript">
//sumbit form
function Check_form() {
  if ($("#cangku").val() == "0") {alert("请选择到货仓库");$("#cangku").focus(); return false;}
  if ($("#yundanhao").val() == "") {alert("请输入包裹运单号");$("#yundanhao").focus(); return false;}
  if ($("#PostOfficeID").val() == "0") {alert("请选择派件快递公司");$("#PostOfficeID").focus(); return false;}
  if ($("#GoodsName").val() == "") {alert("请输入物品名称");$("#GoodsName").focus(); return false;}
  if ($("#GoodsCount").val() == "") {alert("请输入物品数量");$("#GoodsCount").focus(); return false;}
  if ($("#GoodsWorth").val() == "") {alert("请输入物品价值");$("#GoodsWorth").focus(); return false;}
  if ($("#GoodsWeight").val() == "") {alert("请输入物品重量");$("#GoodsWeight").focus(); return false;}
  $("#form_box").submit();
}
</script>
<?php echo $this->fetch('footer.html'); ?>